﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Web.Areas.Portal.Models.AdminModel>" %>
<tr class="access_div">
    <th valign="top">
        Access Control:
    </th>
    <td colspan="2">
        <table class="access-control">
            <% 
                bool check = true;
                
                foreach (var m in Model.AllModules)
                {
                    
                    if (Model.Admin.Modules != null)
                            check = false;
            %>
            <tr>
                <td>
                    <%= Html.CheckBox("SelectedModules", check || (Model.Admin.Modules.SingleOrDefault(x => x.ID == m.ID) == null ? false : true), new { value = m.ID })%>
                </td>
                <td>
                    <%= m.ModuleName%>
                </td>
            </tr>
            <% }%>
        </table>
    </td>
</tr>
